package com.mbti.youmore.service;

import com.mbti.youmore.entity.Favorite;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
* @author Guqier
* @description 针对表【t_favorite】的数据库操作Service
* @createDate 2024-05-08 20:30:45
*/
public interface FavoriteService extends IService<Favorite> {

    List<Map<String, Object>> getFavorite(Integer userId);

    @Transactional // 开启事务
    int addFavorite(Favorite favorite);

    @Transactional
    int cancelFavorite(Integer userId, Integer postId);
}
